/**
 * Created by luqidong on 2018/1/31.
 */
import axios from 'axios';
import {MASTER_URI} from '../../utils/common'
/**
 * 获取竞彩详情
 * @param token
 * @returns {*}
 */
export function getGuessInfoR(token) {
    if(token) {
        return axios.get(`${MASTER_URI}/activity/cbf/active`, {
            headers: {
                token
            }
        });
    }
    return axios.get(`${MASTER_URI}/activity/cbf/active`);
}
/**
 * 我的竞猜
 * @param token
 * @param page
 * @returns {*}
 */
export function myGuessR(token, page) {
    return axios.get(`${MASTER_URI}/activity/cbf/bySelf?page=${page}&pageSize=20`, {
        headers: {
            token
        }
    });
}
/**
 * 往期竞猜
 * @param token
 * @param page
 * @returns {*}
 */
export function beforeGuessR(token, page) {
    return axios.get(`${MASTER_URI}/activity/cbf/history?page=${page}&pageSize=20`);
}
/**
 * 中奖详情
 * @param token
 * @param id
 * @returns {*}
 */
export function guessInfoR(token, id) {
    if(token) {
        return axios.get(`${MASTER_URI}/activity/cbf/byId?id=${id}`, {
            headers: {
                token
            }
        });
    }
    return axios.get(`${MASTER_URI}/activity/cbf/byId?id=${id}`);
}

/**
 * 中奖榜单
 * @param id
 * @param page
 * @returns {*}
 */
export function winsortR(id, page) {
    return axios.get(`${MASTER_URI}/activity/cbf/award?id=${id}&page=${page}&pageSize=20`);
}
/**
 * 猜比分
 * @param token
 * @param params
 * @returns {AxiosPromise|*}
 */
export function sendGussR(token, params) {
    return axios.post(`${MASTER_URI}/activity/cbf/join`, params, {
        headers: {
            token
        }
    });
}